]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Fix for screenshots when pictures path is unavailable
authorBrion Vibber <bvibber@wikimedia.org>
Wed, 18 Dec 2019 22:34:45 +0000 (14:34 -0800)
committerMarge Bot <marge-bot@gnome.org>
Thu, 11 Feb 2021 18:51:40 +0000 (18:51 +0000)
On my local jhbuild setup some local stuff is not set up and
there's no pictures folder. This fixes a regression where it
blew up instead of saving to the home dir in this situation.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1658>

js/ui/screenshot.js

index 8a92c62130a4c5e01c3cbce78b563ab279a50e3f..f10c68f386cd0da98d63bd0d29cb3cc7ba1d4f56 100644 (file)
@@ -84,7 +84,7 @@ var ScreenshotService = class {
         let path = [
             GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES),
             GLib.get_home_dir(),
-        ].find(p => GLib.file_test(p, GLib.FileTest.EXISTS));
+        ].find(p => p && GLib.file_test(p, GLib.FileTest.EXISTS));
 
         if (!path)
             return null;